{% if depth == 0 %}
{# Check if this is a packet-level section (no subsections) or category (has subsections) #}
{% if not section_data.subsections %}
{# Packet-level section (e.g., "Full Packet") - always visible #}
{% endif %}
{# All files in packet-level section are always visible #}
{% for packet_file in section_data.files %}
{% include "hugopacket/bits/packet_file.html" with packet=packet_file %}
{% if not forloop.last %}{% endif %}
{% endfor %}
{% endif %}
{# Category-level files (e.g., "Best Novel - Complete Packet") - always visible #}
{% for packet_file in section_data.files %}
{% include "hugopacket/bits/packet_file.html" with packet=packet_file %}
{% if not forloop.last %}{% endif %}
{% endfor %}
{# Expand/Collapse button for all finalists in this category #}
{# Collapsible container for ALL finalists in this category #}
{% for subsection_data in section_data.subsections %}
{% include "hugopacket/bits/section.html" with section_data=subsection_data depth=depth|add:1 %}
{% endfor %}
{% endif %}
{% for packet_file in section_data.files %}
{% include "hugopacket/bits/packet_file.html" with packet=packet_file %}
{% if not forloop.last %}{% endif %}
{% endfor %}
{% for subsection_data in section_data.subsections %}
{% include "hugopacket/bits/section.html" with section_data=subsection_data depth=depth|add:1 %}
{% endfor %}
{% else %}
{# Deeper nesting levels (depth >= 2) - not collapsible #}
{% if depth == 2 %}
{{ section_data.section.name }}
{% else %}
{{ section_data.section.name }}
{% endif %}
{% if section_data.section.description %}
{% endif %}
{% for packet_file in section_data.files %}
{% include "hugopacket/bits/packet_file.html" with packet=packet_file %}
{% if not forloop.last %}{% endif %}
{% endfor %}
{% for subsection_data in section_data.subsections %}
{% include "hugopacket/bits/section.html" with section_data=subsection_data depth=depth|add:1 %}
{% endfor %}
{% endif %}